.class public Lorg/microemu/app/Config;
.super Ljava/lang/Object;
.source "Config.java"


# static fields
.field static class$org$microemu$app$util$MidletURLReference:Ljava/lang/Class;

.field private static configXml:Lnanoxml/XMLElement;

.field private static defaultDevice:Lorg/microemu/app/util/DeviceEntry;

.field private static emulatorContext:Lorg/microemu/EmulatorContext;

.field private static emulatorID:Ljava/lang/String;

.field private static meHome:Ljava/io/File;

.field private static urlsMRU:Lorg/microemu/app/util/MRUList;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 63
    new-instance v0, Lnanoxml/XMLElement;

    invoke-direct {v0}, Lnanoxml/XMLElement;-><init>()V

    sput-object v0, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    .line 69
    new-instance v0, Lorg/microemu/app/util/MRUList;

    sget-object v1, Lorg/microemu/app/Config;->class$org$microemu$app$util$MidletURLReference:Ljava/lang/Class;

    if-nez v1, :cond_0

    const-string v1, "org.microemu.app.util.MidletURLReference"

    invoke-static {v1}, Lorg/microemu/app/Config;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    sput-object v1, Lorg/microemu/app/Config;->class$org$microemu$app$util$MidletURLReference:Ljava/lang/Class;

    :goto_0
    const-string v2, "midlet"

    invoke-direct {v0, v1, v2}, Lorg/microemu/app/util/MRUList;-><init>(Ljava/lang/Class;Ljava/lang/String;)V

    sput-object v0, Lorg/microemu/app/Config;->urlsMRU:Lorg/microemu/app/util/MRUList;

    return-void

    :cond_0
    sget-object v1, Lorg/microemu/app/Config;->class$org$microemu$app$util$MidletURLReference:Ljava/lang/Class;

    goto :goto_0
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 54
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static addDeviceEntry(Lorg/microemu/app/util/DeviceEntry;)V
    .locals 6
    .parameter "entry"

    .prologue
    .line 299
    invoke-static {}, Lorg/microemu/app/Config;->getDeviceEntries()Ljava/util/Vector;

    move-result-object v4

    invoke-virtual {v4}, Ljava/util/Vector;->elements()Ljava/util/Enumeration;

    move-result-object v2

    .local v2, en:Ljava/util/Enumeration;
    :cond_0
    invoke-interface {v2}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 300
    invoke-interface {v2}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lorg/microemu/app/util/DeviceEntry;

    .line 301
    .local v3, test:Lorg/microemu/app/util/DeviceEntry;
    invoke-virtual {v3}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 317
    .end local v3           #test:Lorg/microemu/app/util/DeviceEntry;
    :goto_0
    return-void

    .line 306
    :cond_1
    sget-object v4, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v5, "devices"

    invoke-virtual {v4, v5}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v1

    .line 308
    .local v1, devicesXml:Lnanoxml/XMLElement;
    const-string v4, "device"

    invoke-virtual {v1, v4}, Lnanoxml/XMLElement;->addChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 309
    .local v0, deviceXml:Lnanoxml/XMLElement;
    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->isDefaultDevice()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 310
    const-string v4, "default"

    const-string v5, "true"

    invoke-virtual {v0, v4, v5}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    .line 312
    :cond_2
    const-string v4, "name"

    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v0, v4, v5}, Lnanoxml/XMLElement;->addChild(Ljava/lang/String;Ljava/lang/String;)Lnanoxml/XMLElement;

    .line 313
    const-string v4, "filename"

    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getFileName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v0, v4, v5}, Lnanoxml/XMLElement;->addChild(Ljava/lang/String;Ljava/lang/String;)Lnanoxml/XMLElement;

    .line 314
    const-string v4, "descriptor"

    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v0, v4, v5}, Lnanoxml/XMLElement;->addChild(Ljava/lang/String;Ljava/lang/String;)Lnanoxml/XMLElement;

    .line 316
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    goto :goto_0
.end method

.method public static changeDeviceEntry(Lorg/microemu/app/util/DeviceEntry;)V
    .locals 7
    .parameter "entry"

    .prologue
    const-string v6, "default"

    .line 347
    sget-object v4, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v5, "devices"

    invoke-virtual {v4, v5}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 348
    .local v0, devicesXml:Lnanoxml/XMLElement;
    if-nez v0, :cond_1

    .line 368
    :cond_0
    :goto_0
    return-void

    .line 352
    :cond_1
    invoke-virtual {v0}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e_device:Ljava/util/Enumeration;
    :cond_2
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 353
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lnanoxml/XMLElement;

    .line 354
    .local v3, tmp_device:Lnanoxml/XMLElement;
    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "device"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 355
    const-string v4, "descriptor"

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 356
    .local v2, testDescriptor:Ljava/lang/String;
    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 357
    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->isDefaultDevice()Z

    move-result v4

    if-eqz v4, :cond_3

    .line 358
    const-string v4, "default"

    const-string v4, "true"

    invoke-virtual {v3, v6, v4}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    .line 363
    :goto_1
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    goto :goto_0

    .line 360
    :cond_3
    const-string v4, "default"

    invoke-virtual {v3, v6}, Lnanoxml/XMLElement;->removeAttribute(Ljava/lang/String;)V

    goto :goto_1
.end method

.method static class$(Ljava/lang/String;)Ljava/lang/Class;
    .locals 2
    .parameter "x0"

    .prologue
    .line 69
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    :catch_0
    move-exception v0

    .local v0, x1:Ljava/lang/ClassNotFoundException;
    new-instance v1, Ljava/lang/NoClassDefFoundError;

    invoke-direct {v1}, Ljava/lang/NoClassDefFoundError;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/NoClassDefFoundError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    move-result-object v1

    throw v1
.end method

.method private static createDefaultConfigXml()V
    .locals 2

    .prologue
    .line 152
    new-instance v0, Lnanoxml/XMLElement;

    invoke-direct {v0}, Lnanoxml/XMLElement;-><init>()V

    sput-object v0, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    .line 153
    sget-object v0, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v1, "config"

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->setName(Ljava/lang/String;)V

    .line 154
    return-void
.end method

.method public static getConfigPath()Ljava/io/File;
    .locals 1

    .prologue
    .line 253
    sget-object v0, Lorg/microemu/app/Config;->meHome:Ljava/io/File;

    if-nez v0, :cond_0

    .line 254
    invoke-static {}, Lorg/microemu/app/Config;->initMEHomePath()Ljava/io/File;

    move-result-object v0

    sput-object v0, Lorg/microemu/app/Config;->meHome:Ljava/io/File;

    .line 256
    :cond_0
    sget-object v0, Lorg/microemu/app/Config;->meHome:Ljava/io/File;

    return-object v0
.end method

.method public static getDeviceEntries()Ljava/util/Vector;
    .locals 9

    .prologue
    .line 260
    new-instance v7, Ljava/util/Vector;

    invoke-direct {v7}, Ljava/util/Vector;-><init>()V

    .line 262
    .local v7, result:Ljava/util/Vector;
    sget-object v0, Lorg/microemu/app/Config;->defaultDevice:Lorg/microemu/app/util/DeviceEntry;

    if-nez v0, :cond_0

    .line 263
    new-instance v0, Lorg/microemu/app/util/DeviceEntry;

    const-string v1, "Default device"

    const/4 v2, 0x0

    const-string v3, "org/microemu/device/default/device.xml"

    const/4 v4, 0x1

    const/4 v5, 0x0

    invoke-direct/range {v0 .. v5}, Lorg/microemu/app/util/DeviceEntry;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)V

    sput-object v0, Lorg/microemu/app/Config;->defaultDevice:Lorg/microemu/app/util/DeviceEntry;

    .line 265
    :cond_0
    sget-object v0, Lorg/microemu/app/Config;->defaultDevice:Lorg/microemu/app/util/DeviceEntry;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lorg/microemu/app/util/DeviceEntry;->setDefaultDevice(Z)V

    .line 266
    sget-object v0, Lorg/microemu/app/Config;->defaultDevice:Lorg/microemu/app/util/DeviceEntry;

    invoke-virtual {v7, v0}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 268
    sget-object v0, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v1, "devices"

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 269
    .local v0, devicesXml:Lnanoxml/XMLElement;
    if-nez v0, :cond_1

    move-object v0, v7

    .line 295
    .end local v7           #result:Ljava/util/Vector;
    .local v0, result:Ljava/util/Vector;
    :goto_0
    return-object v0

    .line 273
    .local v0, devicesXml:Lnanoxml/XMLElement;
    .restart local v7       #result:Ljava/util/Vector;
    :cond_1
    invoke-virtual {v0}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v6

    .end local v0           #devicesXml:Lnanoxml/XMLElement;
    .local v6, e_device:Ljava/util/Enumeration;
    :cond_2
    :goto_1
    invoke-interface {v6}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v0

    if-eqz v0, :cond_5

    .line 274
    invoke-interface {v6}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnanoxml/XMLElement;

    .line 275
    .local v0, tmp_device:Lnanoxml/XMLElement;
    invoke-virtual {v0}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v1

    const-string v2, "device"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 276
    const/4 v3, 0x0

    .line 277
    .local v3, devDefault:Z
    const-string v1, "default"

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    if-eqz v1, :cond_3

    const-string v1, "default"

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "true"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    .line 279
    const/4 v3, 0x1

    .line 280
    sget-object v1, Lorg/microemu/app/Config;->defaultDevice:Lorg/microemu/app/util/DeviceEntry;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lorg/microemu/app/util/DeviceEntry;->setDefaultDevice(Z)V

    .line 282
    :cond_3
    const-string v1, "name"

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 283
    .local v1, devName:Ljava/lang/String;
    const-string v2, "filename"

    const/4 v4, 0x0

    invoke-virtual {v0, v2, v4}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 284
    .local v2, devFile:Ljava/lang/String;
    const-string v4, "class"

    const/4 v5, 0x0

    invoke-virtual {v0, v4, v5}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 285
    .local v4, devClass:Ljava/lang/String;
    const-string v5, "descriptor"

    const/4 v8, 0x0

    invoke-virtual {v0, v5, v8}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 287
    .local v0, devDescriptor:Ljava/lang/String;
    if-nez v0, :cond_4

    .line 288
    new-instance v0, Lorg/microemu/app/util/DeviceEntry;

    .end local v0           #devDescriptor:Ljava/lang/String;
    sget-object v5, Lorg/microemu/app/Config;->emulatorContext:Lorg/microemu/EmulatorContext;

    invoke-direct/range {v0 .. v5}, Lorg/microemu/app/util/DeviceEntry;-><init>(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Lorg/microemu/EmulatorContext;)V

    invoke-virtual {v7, v0}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    goto :goto_1

    .line 290
    .restart local v0       #devDescriptor:Ljava/lang/String;
    :cond_4
    new-instance v4, Lorg/microemu/app/util/DeviceEntry;

    .end local v4           #devClass:Ljava/lang/String;
    invoke-direct {v4, v1, v2, v0, v3}, Lorg/microemu/app/util/DeviceEntry;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V

    invoke-virtual {v7, v4}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    goto :goto_1

    .end local v3           #devDefault:Z
    .end local v1           #devName:Ljava/lang/String;
    .end local v2           #devFile:Ljava/lang/String;
    .end local v0           #devDescriptor:Ljava/lang/String;
    :cond_5
    move-object v0, v7

    .line 295
    .local v0, result:Ljava/util/Vector;
    goto :goto_0
.end method

.method public static getDeviceEntryDisplaySize(Lorg/microemu/app/util/DeviceEntry;)Lorg/microemu/device/impl/Rectangle;
    .locals 10
    .parameter "entry"

    .prologue
    const/4 v9, 0x0

    const/4 v8, -0x1

    .line 371
    sget-object v6, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v7, "devices"

    invoke-virtual {v6, v7}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 373
    .local v0, devicesXml:Lnanoxml/XMLElement;
    if-eqz v0, :cond_1

    .line 374
    invoke-virtual {v0}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e_device:Ljava/util/Enumeration;
    :cond_0
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 375
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lnanoxml/XMLElement;

    .line 376
    .local v5, tmp_device:Lnanoxml/XMLElement;
    invoke-virtual {v5}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v6

    const-string v7, "device"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 377
    const-string v6, "descriptor"

    invoke-virtual {v5, v6, v9}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 378
    .local v4, testDescriptor:Ljava/lang/String;
    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 379
    const-string v6, "rectangle"

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 380
    .local v2, rectangleXml:Lnanoxml/XMLElement;
    if-eqz v2, :cond_0

    .line 381
    new-instance v3, Lorg/microemu/device/impl/Rectangle;

    invoke-direct {v3}, Lorg/microemu/device/impl/Rectangle;-><init>()V

    .line 382
    .local v3, result:Lorg/microemu/device/impl/Rectangle;
    const-string v6, "x"

    invoke-virtual {v2, v6, v8}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v6

    iput v6, v3, Lorg/microemu/device/impl/Rectangle;->x:I

    .line 383
    const-string v6, "y"

    invoke-virtual {v2, v6, v8}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v6

    iput v6, v3, Lorg/microemu/device/impl/Rectangle;->y:I

    .line 384
    const-string v6, "width"

    invoke-virtual {v2, v6, v8}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v6

    iput v6, v3, Lorg/microemu/device/impl/Rectangle;->width:I

    .line 385
    const-string v6, "height"

    invoke-virtual {v2, v6, v8}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v6

    iput v6, v3, Lorg/microemu/device/impl/Rectangle;->height:I

    move-object v6, v3

    .line 394
    .end local v1           #e_device:Ljava/util/Enumeration;
    .end local v5           #tmp_device:Lnanoxml/XMLElement;
    .end local v4           #testDescriptor:Ljava/lang/String;
    .end local v2           #rectangleXml:Lnanoxml/XMLElement;
    .end local v3           #result:Lorg/microemu/device/impl/Rectangle;
    :goto_0
    return-object v6

    :cond_1
    move-object v6, v9

    goto :goto_0
.end method

.method public static getEmulatorID()Ljava/lang/String;
    .locals 1

    .prologue
    .line 547
    sget-object v0, Lorg/microemu/app/Config;->emulatorID:Ljava/lang/String;

    return-object v0
.end method

.method static getExtensions()Ljava/util/Map;
    .locals 12

    .prologue
    .line 176
    new-instance v5, Ljava/util/HashMap;

    invoke-direct {v5}, Ljava/util/HashMap;-><init>()V

    .line 177
    .local v5, extensions:Ljava/util/Map;
    sget-object v10, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v11, "extensions"

    invoke-virtual {v10, v11}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v6

    .line 178
    .local v6, extensionsXml:Lnanoxml/XMLElement;
    if-nez v6, :cond_1

    .line 208
    :cond_0
    return-object v5

    .line 181
    :cond_1
    invoke-virtual {v6}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v3

    .local v3, en:Ljava/util/Enumeration;
    :cond_2
    :goto_0
    invoke-interface {v3}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v10

    if-eqz v10, :cond_0

    .line 182
    invoke-interface {v3}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lnanoxml/XMLElement;

    .line 183
    .local v4, extension:Lnanoxml/XMLElement;
    invoke-virtual {v4}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v10

    const-string v11, "extension"

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v10

    if-eqz v10, :cond_2

    .line 186
    const-string v10, "className"

    const/4 v11, 0x0

    invoke-virtual {v4, v10, v11}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 187
    .local v0, className:Ljava/lang/String;
    if-eqz v0, :cond_2

    .line 191
    new-instance v7, Ljava/util/HashMap;

    invoke-direct {v7}, Ljava/util/HashMap;-><init>()V

    .line 192
    .local v7, parameters:Ljava/util/Map;
    const-string v10, "emulatorID"

    invoke-static {}, Lorg/microemu/app/Config;->getEmulatorID()Ljava/lang/String;

    move-result-object v11

    invoke-interface {v7, v10, v11}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 194
    invoke-virtual {v4}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v2

    .local v2, een:Ljava/util/Enumeration;
    :cond_3
    invoke-interface {v2}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v10

    if-eqz v10, :cond_5

    .line 195
    invoke-interface {v2}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Lnanoxml/XMLElement;

    .line 196
    .local v8, propXml:Lnanoxml/XMLElement;
    invoke-virtual {v8}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v10

    const-string v11, "properties"

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v10

    if-eqz v10, :cond_3

    .line 197
    invoke-virtual {v8}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e_prop:Ljava/util/Enumeration;
    :cond_4
    :goto_1
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v10

    if-eqz v10, :cond_3

    .line 198
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lnanoxml/XMLElement;

    .line 199
    .local v9, tmp_prop:Lnanoxml/XMLElement;
    invoke-virtual {v9}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v10

    const-string v11, "property"

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v10

    if-eqz v10, :cond_4

    .line 200
    const-string v10, "name"

    invoke-virtual {v9, v10}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    const-string v11, "value"

    invoke-virtual {v9, v11}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    invoke-interface {v7, v10, v11}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_1

    .line 206
    .end local v8           #propXml:Lnanoxml/XMLElement;
    .end local v1           #e_prop:Ljava/util/Enumeration;
    .end local v9           #tmp_prop:Lnanoxml/XMLElement;
    :cond_5
    invoke-interface {v5, v0, v7}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0
.end method

.method public static getRecentDirectory(Ljava/lang/String;)Ljava/lang/String;
    .locals 4
    .parameter "key"

    .prologue
    .line 524
    const-string v0, "."

    .line 526
    .local v0, defaultResult:Ljava/lang/String;
    sget-object v2, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v3, "files"

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v1

    .line 527
    .local v1, filesXml:Lnanoxml/XMLElement;
    if-nez v1, :cond_0

    move-object v2, v0

    .line 531
    :goto_0
    return-object v2

    :cond_0
    invoke-virtual {v1, p0, v0}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    goto :goto_0
.end method

.method public static getRecordStoreManagerClassName()Ljava/lang/String;
    .locals 3

    .prologue
    .line 429
    sget-object v1, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v2, "recordStoreManager"

    invoke-virtual {v1, v2}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 430
    .local v0, recordStoreManagerXml:Lnanoxml/XMLElement;
    if-nez v0, :cond_0

    .line 431
    const/4 v1, 0x0

    .line 434
    :goto_0
    return-object v1

    :cond_0
    const-string v1, "class"

    invoke-virtual {v0, v1}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    goto :goto_0
.end method

.method public static getUrlsMRU()Lorg/microemu/app/util/MRUList;
    .locals 1

    .prologue
    .line 543
    sget-object v0, Lorg/microemu/app/Config;->urlsMRU:Lorg/microemu/app/util/MRUList;

    return-object v0
.end method

.method public static getWindow(Ljava/lang/String;Lorg/microemu/device/impl/Rectangle;)Lorg/microemu/device/impl/Rectangle;
    .locals 5
    .parameter "name"
    .parameter "defaultWindow"

    .prologue
    .line 484
    sget-object v3, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v4, "windows"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 485
    .local v2, windowsXml:Lnanoxml/XMLElement;
    if-nez v2, :cond_0

    move-object v3, p1

    .line 500
    :goto_0
    return-object v3

    .line 489
    :cond_0
    invoke-virtual {v2, p0}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 490
    .local v0, mainXml:Lnanoxml/XMLElement;
    if-nez v0, :cond_1

    move-object v3, p1

    .line 491
    goto :goto_0

    .line 494
    :cond_1
    new-instance v1, Lorg/microemu/device/impl/Rectangle;

    invoke-direct {v1}, Lorg/microemu/device/impl/Rectangle;-><init>()V

    .line 495
    .local v1, window:Lorg/microemu/device/impl/Rectangle;
    const-string v3, "x"

    iget v4, p1, Lorg/microemu/device/impl/Rectangle;->x:I

    invoke-virtual {v0, v3, v4}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->x:I

    .line 496
    const-string v3, "y"

    iget v4, p1, Lorg/microemu/device/impl/Rectangle;->y:I

    invoke-virtual {v0, v3, v4}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->y:I

    .line 497
    const-string v3, "width"

    iget v4, p1, Lorg/microemu/device/impl/Rectangle;->width:I

    invoke-virtual {v0, v3, v4}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->width:I

    .line 498
    const-string v3, "height"

    iget v4, p1, Lorg/microemu/device/impl/Rectangle;->height:I

    invoke-virtual {v0, v3, v4}, Lnanoxml/XMLElement;->getChildInteger(Ljava/lang/String;I)I

    move-result v3

    iput v3, v1, Lorg/microemu/device/impl/Rectangle;->height:I

    move-object v3, v1

    .line 500
    goto :goto_0
.end method

.method private static initMEHomePath()Ljava/io/File;
    .locals 4

    .prologue
    .line 73
    :try_start_0
    new-instance v1, Ljava/io/File;

    new-instance v2, Ljava/lang/StringBuffer;

    invoke-direct {v2}, Ljava/lang/StringBuffer;-><init>()V

    const-string v3, "user.home"

    invoke-static {v3}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    const-string v3, "/.microemulator/"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 74
    .local v1, meHome:Ljava/io/File;
    sget-object v2, Lorg/microemu/app/Config;->emulatorID:Ljava/lang/String;

    if-eqz v2, :cond_0

    .line 75
    new-instance v2, Ljava/io/File;

    sget-object v3, Lorg/microemu/app/Config;->emulatorID:Ljava/lang/String;

    invoke-direct {v2, v1, v3}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0

    .line 81
    .end local v1           #meHome:Ljava/io/File;
    :goto_0
    return-object v2

    .restart local v1       #meHome:Ljava/io/File;
    :cond_0
    move-object v2, v1

    .line 77
    goto :goto_0

    .line 79
    .end local v1           #meHome:Ljava/io/File;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 80
    .local v0, e:Ljava/lang/SecurityException;
    const-string v2, "Cannot access user.home"

    invoke-static {v2, v0}, Lorg/microemu/log/Logger;->error(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 81
    const/4 v2, 0x0

    goto :goto_0
.end method

.method private static initSystemProperties()V
    .locals 14

    .prologue
    const-string v13, "value"

    const-string v12, "system-property"

    const-string v11, "system-properties"

    const-string v10, "name"

    .line 212
    const/4 v4, 0x0

    .line 214
    .local v4, systemProperties:Ljava/util/Map;
    sget-object v8, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    invoke-virtual {v8}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v0

    .local v0, e:Ljava/util/Enumeration;
    :cond_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v8

    if-eqz v8, :cond_2

    .line 215
    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lnanoxml/XMLElement;

    .line 216
    .local v5, tmp:Lnanoxml/XMLElement;
    invoke-virtual {v5}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v8

    const-string v9, "system-properties"

    invoke-virtual {v8, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_0

    .line 218
    new-instance v4, Ljava/util/HashMap;

    .end local v4           #systemProperties:Ljava/util/Map;
    invoke-direct {v4}, Ljava/util/HashMap;-><init>()V

    .line 219
    .restart local v4       #systemProperties:Ljava/util/Map;
    invoke-virtual {v5}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e_prop:Ljava/util/Enumeration;
    :cond_1
    :goto_0
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v8

    if-eqz v8, :cond_0

    .line 220
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lnanoxml/XMLElement;

    .line 221
    .local v6, tmp_prop:Lnanoxml/XMLElement;
    invoke-virtual {v6}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v8

    const-string v9, "system-property"

    invoke-virtual {v8, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 222
    const-string v8, "name"

    invoke-virtual {v6, v10}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v9, "value"

    invoke-virtual {v6, v13}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    invoke-interface {v4, v8, v9}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 229
    .end local v5           #tmp:Lnanoxml/XMLElement;
    .end local v1           #e_prop:Ljava/util/Enumeration;
    .end local v6           #tmp_prop:Lnanoxml/XMLElement;
    :cond_2
    if-nez v4, :cond_4

    .line 230
    new-instance v4, Ljava/util/Properties;

    .end local v4           #systemProperties:Ljava/util/Map;
    invoke-direct {v4}, Ljava/util/Properties;-><init>()V

    .line 231
    .restart local v4       #systemProperties:Ljava/util/Map;
    const-string v8, "microedition.configuration"

    const-string v9, "CLDC-1.0"

    invoke-interface {v4, v8, v9}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 232
    const-string v8, "microedition.profiles"

    const-string v9, "MIDP-2.0"

    invoke-interface {v4, v8, v9}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 235
    const-string v8, "avetana.forceNativeLibrary"

    sget-object v9, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    invoke-virtual {v9}, Ljava/lang/Boolean;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-interface {v4, v8, v9}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 237
    sget-object v8, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v9, "system-properties"

    invoke-virtual {v8, v11}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v3

    .line 239
    .local v3, propertiesXml:Lnanoxml/XMLElement;
    invoke-interface {v4}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v8

    invoke-interface {v8}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .end local v0           #e:Ljava/util/Enumeration;
    .local v2, i:Ljava/util/Iterator;
    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v8

    if-eqz v8, :cond_3

    .line 240
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 241
    .local v0, e:Ljava/util/Map$Entry;
    const-string v8, "system-property"

    invoke-virtual {v3, v12}, Lnanoxml/XMLElement;->addChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v7

    .line 242
    .local v7, xmlProperty:Lnanoxml/XMLElement;
    const-string v8, "value"

    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Ljava/lang/String;

    invoke-virtual {v7, v13, v8}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    .line 243
    const-string v8, "name"

    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v0

    .end local v0           #e:Ljava/util/Map$Entry;
    check-cast v0, Ljava/lang/String;

    invoke-virtual {v7, v10, v0}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    goto :goto_1

    .line 246
    .end local v7           #xmlProperty:Lnanoxml/XMLElement;
    :cond_3
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    .line 249
    .end local v3           #propertiesXml:Lnanoxml/XMLElement;
    .end local v2           #i:Ljava/util/Iterator;
    :cond_4
    invoke-static {v4}, Lorg/microemu/app/util/MIDletSystemProperties;->setProperties(Ljava/util/Map;)V

    .line 250
    return-void
.end method

.method public static isLogConsoleLocationEnabled()Z
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 445
    sget-object v1, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v2, "logConsole"

    invoke-virtual {v1, v2}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 446
    .local v0, logConsoleXml:Lnanoxml/XMLElement;
    if-nez v0, :cond_0

    move v1, v3

    .line 450
    :goto_0
    return v1

    :cond_0
    const-string v1, "locationEnabled"

    invoke-virtual {v0, v1, v3}, Lnanoxml/XMLElement;->getBooleanAttribute(Ljava/lang/String;Z)Z

    move-result v1

    goto :goto_0
.end method

.method public static isWindowOnStart(Ljava/lang/String;)Z
    .locals 6
    .parameter "name"

    .prologue
    const/4 v5, 0x0

    .line 465
    sget-object v3, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v4, "windows"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 466
    .local v2, windowsXml:Lnanoxml/XMLElement;
    if-nez v2, :cond_0

    move v3, v5

    .line 479
    :goto_0
    return v3

    .line 470
    :cond_0
    invoke-virtual {v2, p0}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v1

    .line 471
    .local v1, mainXml:Lnanoxml/XMLElement;
    if-nez v1, :cond_1

    move v3, v5

    .line 472
    goto :goto_0

    .line 475
    :cond_1
    const-string v3, "onstart"

    const-string v4, "false"

    invoke-virtual {v1, v3, v4}, Lnanoxml/XMLElement;->getStringAttribute(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 476
    .local v0, attr:Ljava/lang/String;
    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v3

    const-string v4, "true"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 477
    const/4 v3, 0x1

    goto :goto_0

    :cond_2
    move v3, v5

    .line 479
    goto :goto_0
.end method

.method public static loadConfig(Lorg/microemu/app/util/DeviceEntry;Lorg/microemu/EmulatorContext;)V
    .locals 10
    .parameter "defaultDevice"
    .parameter "emulatorContext"

    .prologue
    const-string v9, "config2.xml"

    const-string v7, "config.xml"

    .line 86
    sput-object p0, Lorg/microemu/app/Config;->defaultDevice:Lorg/microemu/app/util/DeviceEntry;

    .line 87
    sput-object p1, Lorg/microemu/app/Config;->emulatorContext:Lorg/microemu/EmulatorContext;

    .line 89
    new-instance v0, Ljava/io/File;

    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v7

    const-string v8, "config2.xml"

    invoke-direct {v0, v7, v9}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 91
    .local v0, configFile:Ljava/io/File;
    :try_start_0
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v7

    if-eqz v7, :cond_1

    .line 92
    const-string v7, "config2.xml"

    invoke-static {v7}, Lorg/microemu/app/Config;->loadConfigFile(Ljava/lang/String;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    .line 122
    :goto_0
    sget-object v7, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    if-nez v7, :cond_0

    .line 123
    invoke-static {}, Lorg/microemu/app/Config;->createDefaultConfigXml()V

    .line 126
    :cond_0
    :goto_1
    sget-object v7, Lorg/microemu/app/Config;->urlsMRU:Lorg/microemu/app/util/MRUList;

    sget-object v8, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v9, "files"

    invoke-virtual {v8, v9}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v8

    const-string v9, "recent"

    invoke-virtual {v8, v9}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v8

    invoke-virtual {v7, v8}, Lorg/microemu/app/util/MRUList;->read(Lnanoxml/XMLElement;)V

    .line 127
    invoke-static {}, Lorg/microemu/app/Config;->initSystemProperties()V

    .line 128
    return-void

    .line 94
    :cond_1
    :try_start_1
    new-instance v1, Ljava/io/File;

    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v7

    const-string v8, "config.xml"

    invoke-direct {v1, v7, v8}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 95
    .local v1, configFile:Ljava/io/File;
    :try_start_2
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    .end local v0           #configFile:Ljava/io/File;
    move-result v7

    if-eqz v7, :cond_3

    .line 97
    const-string v7, "config.xml"

    invoke-static {v7}, Lorg/microemu/app/Config;->loadConfigFile(Ljava/lang/String;)V

    .line 99
    invoke-static {}, Lorg/microemu/app/Config;->getDeviceEntries()Ljava/util/Vector;

    move-result-object v7

    invoke-virtual {v7}, Ljava/util/Vector;->elements()Ljava/util/Enumeration;

    move-result-object v3

    .local v3, e:Ljava/util/Enumeration;
    :cond_2
    :goto_2
    invoke-interface {v3}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v7

    if-eqz v7, :cond_4

    .line 100
    invoke-interface {v3}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lorg/microemu/app/util/DeviceEntry;

    .line 101
    .local v4, entry:Lorg/microemu/app/util/DeviceEntry;
    invoke-virtual {v4}, Lorg/microemu/app/util/DeviceEntry;->canRemove()Z

    move-result v7

    if-eqz v7, :cond_2

    .line 105
    invoke-static {v4}, Lorg/microemu/app/Config;->removeDeviceEntry(Lorg/microemu/app/util/DeviceEntry;)V

    .line 106
    new-instance v6, Ljava/io/File;

    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v7

    invoke-virtual {v4}, Lorg/microemu/app/util/DeviceEntry;->getFileName()Ljava/lang/String;

    move-result-object v8

    invoke-direct {v6, v7, v8}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 107
    .local v6, src:Ljava/io/File;
    const-string v7, "dev"

    const-string v8, ".jar"

    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v9

    invoke-static {v7, v8, v9}, Ljava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;

    move-result-object v2

    .line 108
    .local v2, dst:Ljava/io/File;
    invoke-static {v6, v2}, Lorg/microemu/app/util/IOUtils;->copyFile(Ljava/io/File;Ljava/io/File;)V

    .line 109
    invoke-virtual {v2}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v7}, Lorg/microemu/app/util/DeviceEntry;->setFileName(Ljava/lang/String;)V

    .line 110
    invoke-static {v4}, Lorg/microemu/app/Config;->addDeviceEntry(Lorg/microemu/app/util/DeviceEntry;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2

    .line 117
    .end local v1           #configFile:Ljava/io/File;
    .end local v3           #e:Ljava/util/Enumeration;
    .end local v4           #entry:Lorg/microemu/app/util/DeviceEntry;
    .end local v6           #src:Ljava/io/File;
    .end local v2           #dst:Ljava/io/File;
    :catch_0
    move-exception v7

    move-object v5, v7

    move-object v0, v1

    .line 118
    .restart local v0       #configFile:Ljava/io/File;
    .local v5, ex:Ljava/io/IOException;
    :goto_3
    :try_start_3
    invoke-static {v5}, Lorg/microemu/log/Logger;->error(Ljava/lang/Throwable;)V

    .line 119
    invoke-static {}, Lorg/microemu/app/Config;->createDefaultConfigXml()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    .line 122
    sget-object v7, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    if-nez v7, :cond_0

    .line 123
    invoke-static {}, Lorg/microemu/app/Config;->createDefaultConfigXml()V

    goto/16 :goto_1

    .line 113
    .end local v0           #configFile:Ljava/io/File;
    .end local v5           #ex:Ljava/io/IOException;
    .restart local v1       #configFile:Ljava/io/File;
    :cond_3
    :try_start_4
    invoke-static {}, Lorg/microemu/app/Config;->createDefaultConfigXml()V

    :cond_4
    move-object v0, v1

    .line 115
    .restart local v0       #configFile:Ljava/io/File;
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0

    goto/16 :goto_0

    .line 122
    .end local v1           #configFile:Ljava/io/File;
    .end local v0           #configFile:Ljava/io/File;
    :catchall_0
    move-exception v7

    move-object v0, v1

    .restart local v0       #configFile:Ljava/io/File;
    :goto_4
    sget-object v8, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    if-nez v8, :cond_5

    .line 123
    invoke-static {}, Lorg/microemu/app/Config;->createDefaultConfigXml()V

    :cond_5
    throw v7

    .line 122
    :catchall_1
    move-exception v7

    goto :goto_4

    .line 117
    :catch_1
    move-exception v7

    move-object v5, v7

    goto :goto_3
.end method

.method private static loadConfigFile(Ljava/lang/String;)V
    .locals 9
    .parameter "configFileName"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 131
    new-instance v1, Ljava/io/File;

    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v7

    invoke-direct {v1, v7, p0}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 132
    .local v1, configFile:Ljava/io/File;
    const/4 v4, 0x0

    .line 133
    .local v4, is:Ljava/io/InputStream;
    const-string v6, ""

    .line 135
    .local v6, xml:Ljava/lang/String;
    :try_start_0
    new-instance v2, Ljava/io/BufferedInputStream;

    new-instance v5, Ljava/io/FileInputStream;

    invoke-direct {v5, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Lnanoxml/XMLParseException; {:try_start_0 .. :try_end_0} :catch_0

    .local v5, is:Ljava/io/InputStream;
    :try_start_1
    invoke-direct {v2, v5}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 136
    .end local v4           #is:Ljava/io/InputStream;
    .local v2, dis:Ljava/io/InputStream;
    :goto_0
    invoke-virtual {v2}, Ljava/io/InputStream;->available()I

    move-result v7

    if-lez v7, :cond_0

    .line 137
    invoke-virtual {v2}, Ljava/io/InputStream;->available()I

    move-result v7

    new-array v0, v7, [B

    .line 138
    .local v0, b:[B
    invoke-virtual {v2, v0}, Ljava/io/InputStream;->read([B)I

    .line 139
    new-instance v7, Ljava/lang/StringBuffer;

    invoke-direct {v7}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {v7, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    new-instance v8, Ljava/lang/String;

    invoke-direct {v8, v0}, Ljava/lang/String;-><init>([B)V

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v6

    .line 140
    goto :goto_0

    .line 141
    .end local v0           #b:[B
    :cond_0
    new-instance v7, Lnanoxml/XMLElement;

    invoke-direct {v7}, Lnanoxml/XMLElement;-><init>()V

    sput-object v7, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    .line 142
    sget-object v7, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    invoke-virtual {v7, v6}, Lnanoxml/XMLElement;->parseString(Ljava/lang/String;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Lnanoxml/XMLParseException; {:try_start_1 .. :try_end_1} :catch_1

    .line 147
    invoke-static {v5}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    move-object v4, v5

    .line 149
    .end local v5           #is:Ljava/io/InputStream;
    .end local v2           #dis:Ljava/io/InputStream;
    .restart local v4       #is:Ljava/io/InputStream;
    :goto_1
    return-void

    .line 143
    :catch_0
    move-exception v7

    move-object v3, v7

    .line 144
    .local v3, e:Lnanoxml/XMLParseException;
    :goto_2
    :try_start_2
    invoke-static {v3}, Lorg/microemu/log/Logger;->error(Ljava/lang/Throwable;)V

    .line 145
    invoke-static {}, Lorg/microemu/app/Config;->createDefaultConfigXml()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 147
    invoke-static {v4}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    goto :goto_1

    .end local v3           #e:Lnanoxml/XMLParseException;
    :catchall_0
    move-exception v7

    :goto_3
    invoke-static {v4}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/InputStream;)V

    throw v7

    .end local v4           #is:Ljava/io/InputStream;
    .restart local v5       #is:Ljava/io/InputStream;
    :catchall_1
    move-exception v7

    move-object v4, v5

    .restart local v4       #is:Ljava/io/InputStream;
    goto :goto_3

    .line 143
    .end local v4           #is:Ljava/io/InputStream;
    :catch_1
    move-exception v7

    move-object v3, v7

    move-object v4, v5

    .restart local v4       #is:Ljava/io/InputStream;
    goto :goto_2
.end method

.method public static removeDeviceEntry(Lorg/microemu/app/util/DeviceEntry;)V
    .locals 6
    .parameter "entry"

    .prologue
    .line 320
    sget-object v4, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v5, "devices"

    invoke-virtual {v4, v5}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 321
    .local v0, devicesXml:Lnanoxml/XMLElement;
    if-nez v0, :cond_1

    .line 344
    :cond_0
    :goto_0
    return-void

    .line 325
    :cond_1
    invoke-virtual {v0}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e_device:Ljava/util/Enumeration;
    :cond_2
    :goto_1
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 326
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lnanoxml/XMLElement;

    .line 327
    .local v3, tmp_device:Lnanoxml/XMLElement;
    invoke-virtual {v3}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "device"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 328
    const-string v4, "descriptor"

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 330
    .local v2, testDescriptor:Ljava/lang/String;
    if-nez v2, :cond_3

    .line 331
    invoke-virtual {v0, v3}, Lnanoxml/XMLElement;->removeChild(Lnanoxml/XMLElement;)V

    .line 333
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    goto :goto_1

    .line 336
    :cond_3
    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 337
    invoke-virtual {v0, v3}, Lnanoxml/XMLElement;->removeChild(Lnanoxml/XMLElement;)V

    .line 339
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    goto :goto_0
.end method

.method public static saveConfig()V
    .locals 7

    .prologue
    .line 158
    sget-object v4, Lorg/microemu/app/Config;->urlsMRU:Lorg/microemu/app/util/MRUList;

    sget-object v5, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v6, "files"

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    const-string v6, "recent"

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    invoke-virtual {v4, v5}, Lorg/microemu/app/util/MRUList;->save(Lnanoxml/XMLElement;)V

    .line 160
    new-instance v0, Ljava/io/File;

    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v4

    const-string v5, "config2.xml"

    invoke-direct {v0, v4, v5}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    .line 162
    .local v0, configFile:Ljava/io/File;
    invoke-static {}, Lorg/microemu/app/Config;->getConfigPath()Ljava/io/File;

    move-result-object v4

    invoke-virtual {v4}, Ljava/io/File;->mkdirs()Z

    .line 163
    const/4 v2, 0x0

    .line 165
    .local v2, fw:Ljava/io/FileWriter;
    :try_start_0
    new-instance v3, Ljava/io/FileWriter;

    invoke-direct {v3, v0}, Ljava/io/FileWriter;-><init>(Ljava/io/File;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 166
    .local v3, fw:Ljava/io/FileWriter;
    :try_start_1
    sget-object v4, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    .end local v2           #fw:Ljava/io/FileWriter;
    invoke-virtual {v4, v3}, Lnanoxml/XMLElement;->write(Ljava/io/Writer;)V

    .line 167
    invoke-virtual {v3}, Ljava/io/FileWriter;->close()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 171
    invoke-static {v3}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/Writer;)V

    move-object v2, v3

    .line 173
    .end local v3           #fw:Ljava/io/FileWriter;
    .restart local v2       #fw:Ljava/io/FileWriter;
    :goto_0
    return-void

    .line 168
    :catch_0
    move-exception v4

    move-object v1, v4

    .line 169
    .local v1, ex:Ljava/io/IOException;
    :goto_1
    :try_start_2
    invoke-static {v1}, Lorg/microemu/log/Logger;->error(Ljava/lang/Throwable;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 171
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/Writer;)V

    goto :goto_0

    .end local v1           #ex:Ljava/io/IOException;
    :catchall_0
    move-exception v4

    :goto_2
    invoke-static {v2}, Lorg/microemu/app/util/IOUtils;->closeQuietly(Ljava/io/Writer;)V

    throw v4

    .end local v2           #fw:Ljava/io/FileWriter;
    .restart local v3       #fw:Ljava/io/FileWriter;
    :catchall_1
    move-exception v4

    move-object v2, v3

    .restart local v2       #fw:Ljava/io/FileWriter;
    goto :goto_2

    .line 168
    .end local v2           #fw:Ljava/io/FileWriter;
    :catch_1
    move-exception v4

    move-object v1, v4

    move-object v2, v3

    .restart local v2       #fw:Ljava/io/FileWriter;
    goto :goto_1
.end method

.method public static setDeviceEntryDisplaySize(Lorg/microemu/app/util/DeviceEntry;Lorg/microemu/device/impl/Rectangle;)V
    .locals 8
    .parameter "entry"
    .parameter "rect"

    .prologue
    .line 398
    if-nez p0, :cond_1

    .line 426
    :cond_0
    :goto_0
    return-void

    .line 401
    :cond_1
    sget-object v6, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v7, "devices"

    invoke-virtual {v6, v7}, Lnanoxml/XMLElement;->getChild(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 402
    .local v0, devicesXml:Lnanoxml/XMLElement;
    if-eqz v0, :cond_0

    .line 406
    invoke-virtual {v0}, Lnanoxml/XMLElement;->enumerateChildren()Ljava/util/Enumeration;

    move-result-object v1

    .local v1, e_device:Ljava/util/Enumeration;
    :cond_2
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v6

    if-eqz v6, :cond_0

    .line 407
    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lnanoxml/XMLElement;

    .line 408
    .local v4, tmp_device:Lnanoxml/XMLElement;
    invoke-virtual {v4}, Lnanoxml/XMLElement;->getName()Ljava/lang/String;

    move-result-object v6

    const-string v7, "device"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_2

    .line 409
    const-string v6, "descriptor"

    const/4 v7, 0x0

    invoke-virtual {v4, v6, v7}, Lnanoxml/XMLElement;->getChildString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 410
    .local v3, testDescriptor:Ljava/lang/String;
    invoke-virtual {p0}, Lorg/microemu/app/util/DeviceEntry;->getDescriptorLocation()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v3, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_2

    .line 411
    const-string v6, "rectangle"

    invoke-virtual {v4, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 412
    .local v2, mainXml:Lnanoxml/XMLElement;
    const-string v6, "x"

    invoke-virtual {v2, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    .line 413
    .local v5, xml:Lnanoxml/XMLElement;
    iget v6, p1, Lorg/microemu/device/impl/Rectangle;->x:I

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 414
    const-string v6, "y"

    invoke-virtual {v2, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    .line 415
    iget v6, p1, Lorg/microemu/device/impl/Rectangle;->y:I

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 416
    const-string v6, "width"

    invoke-virtual {v2, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    .line 417
    .restart local v5       #xml:Lnanoxml/XMLElement;
    iget v6, p1, Lorg/microemu/device/impl/Rectangle;->width:I

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 418
    const-string v6, "height"

    invoke-virtual {v2, v6}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v5

    .line 419
    .restart local v5       #xml:Lnanoxml/XMLElement;
    iget v6, p1, Lorg/microemu/device/impl/Rectangle;->height:I

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 421
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    goto :goto_0
.end method

.method public static setEmulatorID(Ljava/lang/String;)V
    .locals 0
    .parameter "emulatorID"

    .prologue
    .line 551
    sput-object p0, Lorg/microemu/app/Config;->emulatorID:Ljava/lang/String;

    .line 552
    return-void
.end method

.method public static setLogConsoleLocationEnabled(Z)V
    .locals 4
    .parameter "state"

    .prologue
    const-string v3, "locationEnabled"

    .line 454
    sget-object v1, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v2, "logConsole"

    invoke-virtual {v1, v2}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 455
    .local v0, logConsoleXml:Lnanoxml/XMLElement;
    if-eqz p0, :cond_0

    .line 456
    const-string v1, "locationEnabled"

    const-string v1, "true"

    invoke-virtual {v0, v3, v1}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    .line 461
    :goto_0
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    .line 462
    return-void

    .line 458
    :cond_0
    const-string v1, "locationEnabled"

    const-string v1, "false"

    invoke-virtual {v0, v3, v1}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public static setRecentDirectory(Ljava/lang/String;Ljava/lang/String;)V
    .locals 4
    .parameter "key"
    .parameter "recentJadDirectory"

    .prologue
    .line 535
    sget-object v2, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v3, "files"

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 536
    .local v0, filesXml:Lnanoxml/XMLElement;
    invoke-virtual {v0, p0}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v1

    .line 537
    .local v1, recentJadDirectoryXml:Lnanoxml/XMLElement;
    invoke-virtual {v1, p1}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 539
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    .line 540
    return-void
.end method

.method public static setRecordStoreManagerClassName(Ljava/lang/String;)V
    .locals 3
    .parameter "className"

    .prologue
    .line 438
    sget-object v1, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v2, "recordStoreManager"

    invoke-virtual {v1, v2}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 439
    .local v0, recordStoreManagerXml:Lnanoxml/XMLElement;
    const-string v1, "class"

    invoke-virtual {v0, v1, p0}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    .line 441
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    .line 442
    return-void
.end method

.method public static setWindow(Ljava/lang/String;Lorg/microemu/device/impl/Rectangle;Z)V
    .locals 6
    .parameter "name"
    .parameter "window"
    .parameter "onStart"

    .prologue
    const-string v5, "onstart"

    .line 504
    sget-object v3, Lorg/microemu/app/Config;->configXml:Lnanoxml/XMLElement;

    const-string v4, "windows"

    invoke-virtual {v3, v4}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v1

    .line 505
    .local v1, windowsXml:Lnanoxml/XMLElement;
    invoke-virtual {v1, p0}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v0

    .line 506
    .local v0, mainXml:Lnanoxml/XMLElement;
    if-eqz p2, :cond_0

    .line 507
    const-string v3, "onstart"

    const-string v3, "true"

    invoke-virtual {v0, v5, v3}, Lnanoxml/XMLElement;->setAttribute(Ljava/lang/String;Ljava/lang/Object;)V

    .line 511
    :goto_0
    const-string v3, "x"

    invoke-virtual {v0, v3}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 512
    .local v2, xml:Lnanoxml/XMLElement;
    iget v3, p1, Lorg/microemu/device/impl/Rectangle;->x:I

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 513
    const-string v3, "y"

    invoke-virtual {v0, v3}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 514
    iget v3, p1, Lorg/microemu/device/impl/Rectangle;->y:I

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 515
    const-string v3, "width"

    invoke-virtual {v0, v3}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 516
    .restart local v2       #xml:Lnanoxml/XMLElement;
    iget v3, p1, Lorg/microemu/device/impl/Rectangle;->width:I

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 517
    const-string v3, "height"

    invoke-virtual {v0, v3}, Lnanoxml/XMLElement;->getChildOrNew(Ljava/lang/String;)Lnanoxml/XMLElement;

    move-result-object v2

    .line 518
    .restart local v2       #xml:Lnanoxml/XMLElement;
    iget v3, p1, Lorg/microemu/device/impl/Rectangle;->height:I

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lnanoxml/XMLElement;->setContent(Ljava/lang/String;)V

    .line 520
    invoke-static {}, Lorg/microemu/app/Config;->saveConfig()V

    .line 521
    return-void

    .line 509
    .end local v2           #xml:Lnanoxml/XMLElement;
    :cond_0
    const-string v3, "onstart"

    invoke-virtual {v0, v5}, Lnanoxml/XMLElement;->removeAttribute(Ljava/lang/String;)V

    goto :goto_0
.end method
